package com.pf.exception;

import com.pf.enums.ResultRespEnum;
import lombok.Getter;
import lombok.Setter;

public class BusinessException extends RuntimeException {

    @Getter
    @Setter
    private Integer code;

    public BusinessException(Integer code, String msg) {
        super(msg);
        this.code = code;
    }

    public BusinessException(String msg) {
        super(msg);
        this.code = ResultRespEnum.SYSTEM_ERROR.getCode();
    }

    public BusinessException(ResultRespEnum resultRespEnum) {
        super(resultRespEnum.getMessage());
        this.code = resultRespEnum.getCode();
    }
}
